﻿<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="Ec2BootstrapperGUI.App"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:src="clr-namespace:Ec2BootstrapperGUI"
    StartupUri="Dashbord.xaml">


    <Application.Resources>
        <!-- Resources scoped at the Application level should be defined here. -->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ServerStopped.xaml"/>
                <ResourceDictionary Source="ServerRunning.xaml"/>
                <ResourceDictionary Source="Simple Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <!-- Window's Style & Template -->
            <LinearGradientBrush x:Key="WindowBackgroundFill" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFAA700" Offset="0.14"/>
                <GradientStop Color="#FFFA7500" Offset="0.74"/>
            </LinearGradientBrush>
            <SolidColorBrush x:Key="WindowBackgroundStroke" Color="#FF787878"/>
            <OuterGlowBitmapEffect x:Key="WindowOuterGlow" GlowColor="#FF070707" GlowSize="7" Opacity="0.7"/>
            <LinearGradientBrush x:Key="WindowTitleBarGloss" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#64FDFDFD" Offset="0"/>
                <GradientStop Color="#00FDFDFD" Offset="1"/>
            </LinearGradientBrush>
            <Style x:Key="WindowButton" BasedOn="{x:Null}" TargetType="{x:Type Button}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Canvas x:Name="WindowButton" Width="26" Height="26">
                                <Rectangle Stroke="{x:Null}" Margin="0,0,0,0" x:Name="ButtonGrlow" Width="26" Height="26" RenderTransformOrigin="0.5,0.5">
                                    <Rectangle.Fill>
                                        <RadialGradientBrush>
                                            <GradientStop Color="#00FAA700" Offset="0.268"/>
                                            <GradientStop Color="#00FAA700" Offset="1"/>
                                        </RadialGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>

                                <Rectangle Fill="#FFFAA700" Stroke="#FFBF6E16" StrokeThickness="0.25" RadiusX="3" RadiusY="3" Margin="3,3,3,3" x:Name="ButtonBase" Width="20" Height="20" />
                                <ContentPresenter Width="14" Height="14" Margin="0,0,0,0" Canvas.Left="6" Canvas.Top="6"/>
                            </Canvas>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsCancel" Value="False"/>
                                <Trigger Property="IsFocused" Value="True"/>
                                <Trigger Property="IsDefaulted" Value="True"/>
                                <Trigger Property="IsMouseOver" SourceName="WindowButton" Value="True">
                                    <Setter Property="Fill" TargetName="ButtonBase" Value="#FFFAB425"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True"/>
                                <Trigger Property="IsEnabled" Value="False"/>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- Menu Style & Template -->
            <SolidColorBrush x:Key="MenuBarStroke" Color="#FFF7931E"/>
            <LinearGradientBrush x:Key="MenuBackground" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#F6F6F6" Offset="0.25"/>
                <GradientStop Color="#EAE8E8" Offset="0.25"/>
                <GradientStop Color="#DCD9D9" Offset="0.8"/>
                <GradientStop Color="White" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="MenuBarBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFAA700" Offset="0"/>
                <GradientStop Color="#B2FF8C0D" Offset="1"/>
            </LinearGradientBrush>
            <Style x:Key="MainWindowMenuStyle" TargetType="{x:Type Menu}">
                <Setter Property="Background" Value="{StaticResource MenuBackground}" />
                <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
                <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
                <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
                <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Menu}">
                            <Border SnapsToDevicePixels="true" BorderThickness="1,1,1,1" Height="30" BorderBrush="{DynamicResource MenuBarStroke}" Background="{DynamicResource MenuBarBackground}">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <LinearGradientBrush x:Key="MenuItemSelectionFill" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#34C5EBFF" Offset="0"/>
                <GradientStop Color="#3481D8FF" Offset="1"/>
            </LinearGradientBrush>
            <Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid Height="30" SnapsToDevicePixels="true">
                    <Rectangle Fill="{x:Null}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="2" RadiusY="2" x:Name="Bg"/>
                    <Rectangle RadiusX="2" RadiusY="2" Margin="1" x:Name="InnerBorder"/>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="17" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
                            <ColumnDefinition Width="14"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
                        <Border Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Visibility="Hidden" Background="#E6EFF4" BorderBrush="#CDD3E6" BorderThickness="1" CornerRadius="3">
                            <Path Fill="#0C12A1" FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Data="{StaticResource Checkmark}"/>
                        </Border>
                        <ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" Grid.Column="2" x:Name="contentPresenter" VerticalAlignment="Center"/>
                        <TextBlock HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" VerticalAlignment="Stretch" Grid.Column="4" Text="{TemplateBinding InputGestureText}"/>
                    </Grid>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="Icon" Value="{x:Null}">
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Stroke" TargetName="Bg" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                        <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource MenuItemHighlightedFill}"/>
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A"/>
                        <Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9"/>
                        <Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6"/>
                        <Setter Property="Fill" TargetName="Glyph" Value="#848589"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <LinearGradientBrush x:Key="MenuItemPressedFill" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#28717070" Offset="0"/>
                <GradientStop Color="#50717070" Offset="0.75"/>
                <GradientStop Color="#90717070" Offset="1"/>
            </LinearGradientBrush>
            <Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
                <Setter Property="ClickMode" Value="Hover"/>
                <Setter Property="MinWidth" Value="0"/>
                <Setter Property="MinHeight" Value="0"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                            <DockPanel SnapsToDevicePixels="true" Background="Transparent">
                                <Rectangle Fill="Transparent" x:Name="R1" Width="1" DockPanel.Dock="Right"/>
                                <Rectangle Fill="Transparent" x:Name="B1" Height="1" DockPanel.Dock="Bottom"/>
                                <Rectangle Fill="Transparent" x:Name="L1" Width="1" DockPanel.Dock="Left"/>
                                <Rectangle Fill="Transparent" x:Name="T1" Height="1" DockPanel.Dock="Top"/>
                                <ContentPresenter HorizontalAlignment="Center" Margin="2,2,2,2" x:Name="ContentContainer" VerticalAlignment="Center"/>
                            </DockPanel>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Fill" TargetName="R1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
                                    <Setter Property="Fill" TargetName="B1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
                                    <Setter Property="Fill" TargetName="L1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
                                    <Setter Property="Fill" TargetName="T1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
                                    <Setter Property="Margin" TargetName="ContentContainer" Value="3,3,1,1"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
            <MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
            <Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
            <!--
			<Style x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
				<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
				<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type ScrollViewer}">
							<Grid SnapsToDevicePixels="true">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="*"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
								<Border Grid.Column="0" Grid.Row="1">
									<ScrollContentPresenter Margin="{TemplateBinding Padding}"/>
								</Border>
								<RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="0">
                                <RepeatButton.Visibility>
										<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
											<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
										</MultiBinding>
									</RepeatButton.Visibility>
									<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource UpArrow}"/>
								</RepeatButton>
								<RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="2">
									<RepeatButton.Visibility>
										<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
											<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
										</MultiBinding>
									</RepeatButton.Visibility>
									<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource DownArrow}"/>
								</RepeatButton>
							</Grid>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
			-->
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}" TargetType="{x:Type ContentControl}">
                <Border Background="#F5F5F5" BorderBrush="#FF959595" BorderThickness="1">
                    <Grid>
                        <Rectangle Fill="#F1F1F1" RadiusX="2" RadiusY="2" HorizontalAlignment="Left" Margin="2" Width="28"/>
                        <Rectangle Fill="#E2E3E3" HorizontalAlignment="Left" Margin="30,2,0,2" Width="1"/>
                        <Rectangle Fill="White" HorizontalAlignment="Left" Margin="31,2,0,2" Width="1"/>
                        <ContentPresenter Margin="1,0" Grid.ColumnSpan="2"/>
                    </Grid>
                </Border>
            </ControlTemplate>
            <SolidColorBrush x:Key="MenuItemHighlightedStroke" Color="#FFC25A00"/>
            <LinearGradientBrush x:Key="MenuItemHighlightedFill" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFA7500" Offset="0.004"/>
                <GradientStop Color="#FFC95E00" Offset="1"/>
            </LinearGradientBrush>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid SnapsToDevicePixels="true" x:Name="grid" VerticalAlignment="Stretch">
                    <Rectangle RadiusX="3" RadiusY="3" x:Name="OuterBorder" />
                    <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="1" RadiusY="1" Margin="1" x:Name="Bg" />
                    <Rectangle Margin="2" x:Name="InnerBorder"/>
                    <DockPanel>
                        <ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
                        <Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}"/>
                        <ContentPresenter HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
                    </DockPanel>
                    <Popup x:Name="PART_Popup" AllowsTransparency="true" HorizontalOffset="1" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-1" Focusable="false">
                        <Microsoft_Windows_Themes:SystemDropShadowChrome Margin="0,0,0,0" x:Name="Shdw" Color="Transparent" CornerRadius="3,3,3,3">
                            <ContentControl Margin="0,5,0,0" x:Name="SubMenuBorder" Foreground="#FFFFFFFF" IsTabStop="false" Template="{DynamicResource MenuItemContentControlControlTemplate}">
                                <ScrollViewer Style="{DynamicResource MenuItemsScrollViewerStyle}" CanContentScroll="false">
                                    <ItemsPresenter HorizontalAlignment="Stretch" Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
                                </ScrollViewer>
                            </ContentControl>
                        </Microsoft_Windows_Themes:SystemDropShadowChrome>
                    </Popup>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                        <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
                    </Trigger>
                    <Trigger Property="Icon" Value="{x:Null}">
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                        <Setter Property="Fill" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedFill}"/>
                        <Setter Property="Stroke" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                    </Trigger>
                    <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                        <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
                        <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Fill" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedFill}"/>
                        <Setter Property="Stroke" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                    </Trigger>
                    <Trigger Property="IsKeyboardFocused" Value="true">
                        <Setter Property="Fill" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedFill}"/>
                        <Setter Property="Stroke" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                    </Trigger>
                    <Trigger Property="IsSubmenuOpen" Value="true">
                        <Setter Property="Stroke" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                        <Setter Property="Fill" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedFill}"/>
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A"/>
                        <Setter Property="Fill" TargetName="GlyphPanel" Value="#848589"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid x:Name="grid" SnapsToDevicePixels="true" Background="{x:Null}">
                    <Rectangle RadiusX="3" RadiusY="3" x:Name="OuterBorder"/>
                    <Rectangle Fill="{x:Null}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="1" RadiusY="1" Margin="1" x:Name="Bg"/>
                    <Rectangle Margin="2" x:Name="InnerBorder"/>
                    <DockPanel>
                        <ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
                        <Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}"/>
                        <ContentPresenter Margin="{TemplateBinding Padding}" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
                    </DockPanel>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="Icon" Value="{x:Null}">
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Fill" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedFill}"/>
                        <Setter Property="Stroke" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                    </Trigger>
                    <Trigger Property="IsKeyboardFocused" Value="true">
                        <Setter Property="Fill" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedFill}"/>
                        <Setter Property="Stroke" TargetName="OuterBorder" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A"/>
                        <Setter Property="Fill" TargetName="GlyphPanel" Value="#848589"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid SnapsToDevicePixels="true" x:Name="grid" Background="{x:Null}">
                    <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="3" RadiusY="3" x:Name="Bg"/>
                    <Rectangle Stroke="Transparent" StrokeThickness="1" RadiusX="3" RadiusY="2" Margin="1" x:Name="InnerBorder"/>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition SharedSizeGroup="MenuItemIconColumnGroup" MinWidth="1" Width="Auto"/>
                            <ColumnDefinition Width="4"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="37"/>
                            <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
                            <ColumnDefinition Width="17"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter Margin="1" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
                        <Border Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Visibility="Hidden" Background="#E6EFF4" BorderBrush="#CDD3E6" BorderThickness="1" CornerRadius="3">
                            <Path Fill="#0C12A1" FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Data="{StaticResource Checkmark}"/>
                        </Border>
                        <ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" Grid.Column="2" VerticalAlignment="Center"/>
                        <TextBlock Margin="{TemplateBinding Padding}" Visibility="Collapsed" Grid.Column="4" Text="{TemplateBinding InputGestureText}"/>
                        <Path Fill="{TemplateBinding Foreground}" Margin="4,0,0,0" VerticalAlignment="Center" Grid.Column="5" Data="{StaticResource RightArrow}"/>
                    </Grid>
                    <Popup x:Name="PART_Popup" AllowsTransparency="true" HorizontalOffset="3" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3" Focusable="false">
                        <Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
                            <ContentControl x:Name="SubMenuBorder" IsTabStop="false" Template="{DynamicResource MenuItemContentControlControlTemplate}">
                                <ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
                                    <ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
                                </ScrollViewer>
                            </ContentControl>
                        </Microsoft_Windows_Themes:SystemDropShadowChrome>
                    </Popup>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                        <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource MenuItemHighlightedFill}"/>
                        <Setter Property="Stroke" TargetName="Bg" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                    </Trigger>
                    <Trigger Property="Icon" Value="{x:Null}"/>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                    </Trigger>
                    <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                        <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
                        <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Fill" TargetName="Bg" Value="{DynamicResource MenuItemHighlightedFill}"/>
                        <Setter Property="Stroke" TargetName="Bg" Value="{DynamicResource MenuItemHighlightedStroke}"/>
                        <Setter Property="VerticalAlignment" TargetName="grid" Value="Stretch"/>
                        <Setter Property="HorizontalAlignment" TargetName="grid" Value="Stretch"/>
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A"/>
                        <Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9"/>
                        <Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6"/>
                        <Setter Property="Fill" TargetName="Glyph" Value="#848589"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
                <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
                <Style.Triggers>
                    <Trigger Property="Role" Value="TopLevelHeader">
                        <Setter Property="Padding" Value="7,2,8,3"/>
                        <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
                    </Trigger>
                    <Trigger Property="Role" Value="TopLevelItem">
                        <Setter Property="Padding" Value="7,2,8,3"/>
                        <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
                    </Trigger>
                    <Trigger Property="Role" Value="SubmenuHeader">
                        <Setter Property="Padding" Value="2,3,2,3"/>
                        <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
                    </Trigger>
                    <Trigger Property="Role" Value="SubmenuItem">
                        <Setter Property="Padding" Value="2,3,2,3"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <SolidColorBrush x:Key="MenuPopupBackground" Color="#FFFAA700"/>

            <SolidColorBrush x:Key="MenuPopupBorderBrush" Color="#FFF7931E"/>
            <Style x:Key="MenuItemsScrollViewerStyle" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
                <Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
                <Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollViewer}">
                            <Grid SnapsToDevicePixels="true">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Border Background="{x:Null}" Grid.Column="0" Grid.Row="1" BorderBrush="{x:Null}" CornerRadius="3,3,3,3">
                                    <ScrollContentPresenter Margin="{TemplateBinding Padding}"/>
                                </Border>
                                <!--
								<RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="0">
									<RepeatButton.Visibility>
										<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
											<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
										</MultiBinding>
									</RepeatButton.Visibility>
									<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource UpArrow}"/>
								</RepeatButton>
								<RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="2">
									<RepeatButton.Visibility>
										<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
											<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
											<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
										</MultiBinding>
									</RepeatButton.Visibility>
									<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource DownArrow}"/>
								</RepeatButton>
                                -->
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <ControlTemplate x:Key="MenuItemContentControlControlTemplate" TargetType="{x:Type ContentControl}">
                <Border Background="{DynamicResource MenuPopupBackground}" BorderBrush="{DynamicResource MenuPopupBorderBrush}" BorderThickness="1" CornerRadius="3,3,3,3">
                    <Grid>
                        <Rectangle Fill="{x:Null}" RadiusX="2" RadiusY="2" HorizontalAlignment="Left" Margin="2" Width="28"/>
                        <Rectangle Fill="{x:Null}" HorizontalAlignment="Left" Margin="30,2,0,2" Width="1"/>
                        <Rectangle Fill="{x:Null}" HorizontalAlignment="Left" Margin="31,2,0,2" Width="1"/>
                        <ContentPresenter Margin="1,0" Grid.ColumnSpan="2"/>
                    </Grid>
                </Border>
            </ControlTemplate>
            <SolidColorBrush x:Key="ContentBackgroundFill" Color="#FF1F1F1F"/>
            <LinearGradientBrush x:Key="ContentContainerBackgroundStroke" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF000000" Offset="0"/>
                <GradientStop Color="#7FFFFFFF" Offset="1"/>
            </LinearGradientBrush>
            <Style x:Key="ListBoxStyle" TargetType="{x:Type ListBox}">
                <Setter Property="SnapsToDevicePixels" Value="true"/>
                <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource SolidBorderBrush}"/>
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
                <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBox}">
                            <Grid>
                                <Border x:Name="Border" BorderBrush="{x:Null}" BorderThickness="{TemplateBinding BorderThickness}" Background="{x:Null}"/>
                                <ScrollViewer Margin="1" Style="{DynamicResource ScrollViewerStyle}" Focusable="false" Background="{x:Null}" Foreground="#FFFFFFFF">

                                    <!-- The StackPanel is used to display the children by setting IsItemsHost to be Trus -->
                                    <StackPanel Margin="2" IsItemsHost="true"/>

                                </ScrollViewer>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Background" TargetName="Border" Value="{x:Null}"/>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="{x:Null}"/>
                                </Trigger>
                                <Trigger Property="IsGrouping" Value="true">
                                    <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ScrollViewerStyle" TargetType="{x:Type ScrollViewer}" BasedOn="{x:Null}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollViewer}">
                            <Grid Background="{TemplateBinding Background}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ScrollContentPresenter Grid.Column="0" Grid.Row="0" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}"/>

                                <!-- The visibility of the ScrollBars is controlled by the implementation fo the control -->
                                <ScrollBar Visibility="Hidden" Grid.Column="0" Grid.Row="1" x:Name="PART_HorizontalScrollBar" Style="{DynamicResource SimpleScrollBar}" Orientation="Horizontal" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Minimum="0" Maximum="{TemplateBinding ScrollableWidth}" AutomationProperties.AutomationId="HorizontalScrollBar"/>
                                <ScrollBar Visibility="Visible" Grid.Column="1" Grid.Row="0" x:Name="PART_VerticalScrollBar" Style="{DynamicResource ScrollBarStyle}" Orientation="Vertical" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Minimum="0" Maximum="{TemplateBinding ScrollableHeight}" AutomationProperties.AutomationId="VerticalScrollBar"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="CanContentScroll" Value="False"/>
            </Style>
            <Style x:Key="ScrollBarStyle" TargetType="{x:Type ScrollBar}">
                <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollBar}">
                            <Grid x:Name="GridRoot" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Background="{x:Null}">
                                <Grid.RowDefinitions>
                                    <RowDefinition MaxHeight="18"/>
                                    <RowDefinition Height="0.00001*"/>
                                    <RowDefinition MaxHeight="18"/>
                                </Grid.RowDefinitions>

                                <RepeatButton x:Name="DecreaseRepeat" Style="{DynamicResource RepeatButtonStyle}" Command="ScrollBar.LineUpCommand" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}"/>

                                <!-- Track is a special layout container which sizes the thumb and the repeat button which do jump scrolling either side of it -->
                                <Track Grid.Row="1" x:Name="PART_Track" Orientation="Vertical" IsDirectionReversed="true">
                                    <Track.Thumb>
                                        <Thumb Style="{DynamicResource ThumbStyle}"/>
                                    </Track.Thumb>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton x:Name="PageUp" Style="{DynamicResource SimpleScrollRepeatButtonStyle}" Command="ScrollBar.PageDownCommand"/>
                                    </Track.IncreaseRepeatButton>
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton x:Name="PageDown" Style="{DynamicResource SimpleScrollRepeatButtonStyle}" Command="ScrollBar.PageUpCommand"/>
                                    </Track.DecreaseRepeatButton>
                                </Track>

                                <RepeatButton Grid.Row="2" x:Name="IncreaseRepeat" Style="{DynamicResource RepeatButtonStyle}" Command="ScrollBar.LineDownCommand" Background="{x:Null}" Foreground="{x:Null}" BorderBrush="{x:Null}" RenderTransformOrigin="0.5,0.5">
                                    <RepeatButton.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                            <SkewTransform AngleX="0" AngleY="0"/>
                                            <RotateTransform Angle="0"/>
                                            <TranslateTransform X="0" Y="0"/>
                                        </TransformGroup>
                                    </RepeatButton.RenderTransform>
                                </RepeatButton>
                            </Grid>

                            <!-- This uses a single template for ScrollBar and rotate it to be Horizontal
					It also changes the commands so that the it does Left and Right instead of Up and Down Commands -->
                            <ControlTemplate.Triggers>
                                <Trigger Property="Orientation" Value="Horizontal">

                                    <!-- Rotate the ScrollBar from Vertical to Horizontal -->
                                    <Setter Property="LayoutTransform" TargetName="GridRoot">
                                        <Setter.Value>
                                            <RotateTransform Angle="-90"/>
                                        </Setter.Value>
                                    </Setter>

                                    <!-- Track is bound to Orientation internally, so we need to rotate it back to Vertical -->
                                    <Setter TargetName="PART_Track" Property="Orientation" Value="Vertical"/>

                                    <!-- Change the commands to do Horizontal commands -->
                                    <Setter Property="Command" Value="ScrollBar.LineLeftCommand" TargetName="DecreaseRepeat"/>
                                    <Setter Property="Command" Value="ScrollBar.LineRightCommand" TargetName="IncreaseRepeat"/>
                                    <Setter Property="Command" Value="ScrollBar.PageLeftCommand" TargetName="PageDown"/>
                                    <Setter Property="Command" Value="ScrollBar.PageRightCommand" TargetName="PageUp"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <SolidColorBrush x:Key="RepeatButtonStyleOver" Color="#FFF9A600"/>
            <SolidColorBrush x:Key="RepeatButtonStyleOff" Color="#FF4D4D4D"/>
            <Style x:Key="RepeatButtonStyle" d:IsControlPart="True" TargetType="{x:Type RepeatButton}" BasedOn="{x:Null}">
                <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                            <Grid>
                                <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" Background="{x:Null}">
                                    <Canvas Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                        <Path StrokeThickness="1.0" Stroke="{DynamicResource RepeatButtonStyleOver}" StrokeMiterLimit="1.0" Fill="{DynamicResource RepeatButtonStyleOver}" Data="M-4.2845223,5.75 C-5.6705288,5.75 -6.2970317,4.7735 -5.6775288,3.58 L-1.2103413,-5.0206667 C-0.59083842,-6.2153333 0.42416631,-6.2153333 1.0436692,-5.0206667 L5.5108567,3.58 C6.1303596,4.7735 5.5038567,5.75 4.1178502,5.75 L-4.2845223,5.75 z" Canvas.Top="8" Canvas.Left="8" x:Name="path" Width="Auto" Height="Auto" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" Margin="0,0,0,0" >
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                                    <SkewTransform AngleX="0" AngleY="0"/>
                                                    <RotateTransform Angle="0"/>
                                                    <TranslateTransform X="0" Y="0"/>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Canvas>
                                </Border>
                                <ContentPresenter HorizontalAlignment="Center" x:Name="ContentPresenter" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" d:IsLocked="True"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsKeyboardFocused" Value="true"/>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Fill" TargetName="path" Value="{DynamicResource RepeatButtonStyleOver}"/>
                                    <Setter Property="Stroke" TargetName="path" Value="{DynamicResource RepeatButtonStyleOver}"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Fill" TargetName="path" Value="#FF4D4D4D"/>
                                    <Setter Property="Stroke" TargetName="path" Value="#FF4D4D4D"/>
                                </Trigger>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsEnabled" Value="False"/>
                                        <Condition Property="Delay" Value="500"/>
                                    </MultiTrigger.Conditions>
                                    <Setter Property="Fill" TargetName="path" Value="{DynamicResource RepeatButtonStyleOff}"/>
                                    <Setter Property="Stroke" TargetName="path" Value="{DynamicResource RepeatButtonStyleOff}"/>
                                </MultiTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ThumbStyle" d:IsControlPart="True" TargetType="{x:Type Thumb}" BasedOn="{x:Null}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Thumb}">
                            <Grid Margin="0,0,0,0" x:Name="Grid">
                                <Rectangle HorizontalAlignment="Stretch" x:Name="Rectangle" VerticalAlignment="Stretch" Width="8" Height="Auto" RadiusX="3" RadiusY="3" Fill="{DynamicResource RepeatButtonStyleOver}" Stroke="{x:Null}" Margin="0,0,0,0"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsFocused" Value="True"/>
                                <Trigger Property="IsMouseOver" Value="True"/>
                                <Trigger Property="IsEnabled" Value="False"/>
                                <Trigger Property="IsDragging" Value="True"/>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Height" Value="Auto"/>
            </Style>
            <LinearGradientBrush x:Key="SelectedListBoxItemBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFA7500" Offset="1"/>
                <GradientStop Color="#FFFAA700" Offset="0"/>
            </LinearGradientBrush>
            <SolidColorBrush x:Key="ListBoxItemStyleForeground" Color="#FFFFFFFF"/>
            <Style x:Key="ListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="Padding" Value="2,0,2,0"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <Border x:Name="Bd" SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Background="{x:Null}" CornerRadius="8,8,8,8">
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="true">
                                    <Setter Property="Foreground" Value="{DynamicResource ListBoxItemStyleForeground}"/>
                                    <Setter Property="Background" TargetName="Bd" Value="{DynamicResource SelectedListBoxItemBackground}"/>
                                </Trigger>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsSelected" Value="true"/>
                                        <Condition Property="Selector.IsSelectionActive" Value="false"/>
                                    </MultiTrigger.Conditions>
                                    <Setter Property="Foreground" Value="{DynamicResource ListBoxItemStyleForeground}"/>
                                    <Setter Property="Background" TargetName="Bd" Value="{DynamicResource SelectedListBoxItemBackground}"/>
                                </MultiTrigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- Context Menu Style & Template -->
            <Style x:Key="ContextMenuStyle" TargetType="{x:Type ContextMenu}">
                <Setter Property="BorderBrush" Value="#FFF7931E"/>
                <Setter Property="Background" Value="{StaticResource MenuBackground}" />
                <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
                <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
                <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
                <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ContextMenu}">
                            <Border SnapsToDevicePixels="true" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource MenuPopupBorderBrush}" Background="{DynamicResource MenuPopupBackground}" CornerRadius="3">

                                <ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <DropShadowBitmapEffect x:Key="ContextMenuDropShadow" />
            <LinearGradientBrush x:Key="TabItemStyleBackground" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#FF404040" Offset="0"/>
                <GradientStop Color="#FF3C3C3C" Offset="1"/>
            </LinearGradientBrush>
            <Style x:Key="TabItemStyle" d:IsControlPart="True" TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid>
                                <Border Margin="0,0,-4,0" x:Name="Border" BorderBrush="{x:Null}" BorderThickness="0,0,0,0" CornerRadius="8,8,0,0" Background="{x:Null}" Padding="16,6,16,14">
                                    <ContentPresenter HorizontalAlignment="Center" Margin="12,2,12,2" x:Name="ContentSite" VerticalAlignment="Center" RecognizesAccessKey="True" ContentSource="Header"/>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Panel.ZIndex" Value="100"/>
                                    <Setter Property="Background" TargetName="Border" Value="#FF3C3C3C"/>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="#FF3C3C3C"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="TabControlStyle" TargetType="{x:Type TabControl}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabControl}">
                            <Grid KeyboardNavigation.TabNavigation="Local">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>

                                <!-- TabPanel is a layout container which allows the TabItems to wrap and re-order when selected
						The implementation knows to use this control because it is marked IsItemsHost = True -->
                                <TabPanel Grid.Row="0" Margin="0,0,4,-8" x:Name="HeaderPanel" Background="{x:Null}" IsItemsHost="True" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1"/>

                                <Border Grid.Row="1" x:Name="Border" BorderBrush="{x:Null}" BorderThickness="0,0,0,0" CornerRadius="8,8,8,8" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="2" OpacityMask="{x:Null}">
                                    <Border.Background>

                                        <!-- LightBrush is used for content areas such as Menu, Tab Control background -->
                                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FF3C3C3C" Offset="0.004"/>
                                            <GradientStop Color="#001F1F1F" Offset="1"/>
                                        </LinearGradientBrush>

                                    </Border.Background>

                                    <!-- The implementation switches the content. This control must be named PART_SelectedContentHost -->
                                    <ContentPresenter Margin="4" x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>

                                </Border>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>

                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <SolidColorBrush x:Key="ListItemHeaderForeground" Color="#FFFAA700"/>
            <SolidColorBrush x:Key="ListBorder" Color="#828790"/>
            <Style x:Key="ListViewItemStyle" TargetType="{x:Type ListViewItem}">
                <Setter Property="Template" Value="{DynamicResource ListViewItemControlTemplate}"/>
            </Style>
            <SolidColorBrush x:Key="ListViewItemMouseOverBackground" Color="#FFFAA700"/>
            <ControlTemplate x:Key="ListViewItemControlTemplate" TargetType="{x:Type ListViewItem}">
                <Border SnapsToDevicePixels="True" Background="{x:Null}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="8,8,8,8" x:Name="border" Padding="8,4,8,4">
                    <Border x:Name="InnerBorder" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition MaxHeight="11"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Rectangle Fill="#75FFFFFF" x:Name="UpperHighlight" Visibility="Collapsed" d:IsHidden="True"/>
                            <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.RowSpan="2" Columns="{TemplateBinding GridView.ColumnCollection}" Content="{TemplateBinding Content}"/>
                        </Grid>
                    </Border>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="BorderBrush" Value="#FFCCF0FF"/>
                        <Setter Property="Background" TargetName="border" Value="#7FFAA700"/>
                    </Trigger>
                    <Trigger Property="IsSelected" Value="True">
                        <Setter Property="Background" TargetName="border" Value="{DynamicResource ListViewItemMouseOverBackground}"/>
                    </Trigger>
                    <MultiTrigger>
                        <MultiTrigger.Conditions>
                            <Condition Property="IsSelected" Value="True"/>
                            <Condition Property="Selector.IsSelectionActive" Value="False"/>
                        </MultiTrigger.Conditions>
                        <Setter Property="Background" TargetName="InnerBorder" Value="{DynamicResource ListViewItemMouseOverBackground}"/>
                    </MultiTrigger>
                    <MultiTrigger>
                        <MultiTrigger.Conditions>
                            <Condition Property="IsSelected" Value="True"/>
                            <Condition Property="IsMouseOver" Value="True"/>
                        </MultiTrigger.Conditions>
                        <Setter Property="Background" TargetName="border" Value="{DynamicResource ListViewItemMouseOverBackground}"/>
                    </MultiTrigger>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="{x:Type ScrollViewer}">
                <Setter Property="Focusable" Value="false"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollViewer}">
                            <Grid SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <DockPanel Margin="{TemplateBinding Padding}">
                                    <ScrollViewer Focusable="false" DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Margin="0,0,0,8">
                                        <GridViewHeaderRowPresenter Margin="2,0,2,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" AllowsColumnReorder="{Binding Path=TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContainerStyle="{DynamicResource GridViewColumnHeaderStyle}" ColumnHeaderContextMenu="{Binding Path=TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderTemplate="{Binding Path=TemplatedParent.View.ColumnHeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderTemplateSelector="{Binding Path=TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderToolTip="{Binding Path=TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}" Columns="{Binding Path=TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Stretch"/>
                                    </ScrollViewer>
                                    <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" KeyboardNavigation.DirectionalNavigation="Local" CanContentScroll="{TemplateBinding CanContentScroll}"/>
                                </DockPanel>
                                <ScrollBar Cursor="Arrow" x:Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0.0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{DynamicResource ScrollBarStyle}"/>
                                <ScrollBar Cursor="Arrow" x:Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0.0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{DynamicResource ScrollBarStyle}" BorderThickness="0,0,0,0" Margin="0,24,0,0"/>
                                <DockPanel Grid.Column="1" Grid.Row="1" LastChildFill="false" Background="{x:Null}">
                                    <Rectangle Fill="{x:Null}" Width="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" DockPanel.Dock="Left"/>
                                    <Rectangle Fill="{x:Null}" Height="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" DockPanel.Dock="Top"/>
                                </DockPanel>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ListViewHeaderStyle" TargetType="{x:Type ListView}">
                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
                <Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Foreground" Value="#FF042271"/>
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
                <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListView}">
                            <Microsoft_Windows_Themes:ListBoxChrome x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
                                <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}" Padding="{TemplateBinding Padding}" Foreground="#FFFFFFFF" BorderBrush="{x:Null}">
                                    <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </ScrollViewer>
                            </Microsoft_Windows_Themes:ListBoxChrome>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="GridViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
                <Setter Property="Foreground" Value="{DynamicResource ListItemHeaderForeground}" />
                <Setter Property="Template" Value="{DynamicResource GridViewColumnHeaderControlTemplate}"/>
            </Style>
            <ControlTemplate x:Key="GridViewColumnHeaderControlTemplate" TargetType="{x:Type GridViewColumnHeader}">
                <Grid SnapsToDevicePixels="True">
                    <Border x:Name="HeaderBorder" BorderThickness="0,1,0,1" Background="{x:Null}" BorderBrush="{x:Null}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition MaxHeight="7"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Rectangle Fill="#FFE3F7FF" x:Name="UpperHighlight" Visibility="Collapsed"/>
                            <Border Padding="{TemplateBinding Padding}" Grid.RowSpan="2">
                                <ContentPresenter HorizontalAlignment="Left" Margin="16,0,16,1" x:Name="HeaderContent" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True"/>
                            </Border>
                        </Grid>
                    </Border>
                    <Border Margin="1,1,0,0" x:Name="HeaderHoverBorder" BorderThickness="1,0,1,1"/>
                    <Border Margin="1,0,0,1" x:Name="HeaderPressBorder" BorderThickness="1,1,1,0"/>
                    <Canvas x:Name="canvas">
                        <Thumb x:Name="PART_HeaderGripper" Background="{DynamicResource ListItemHeaderForeground}" Foreground="{DynamicResource ListItemHeaderForeground}">
                            <Thumb.Style>
                                <Style TargetType="{x:Type Thumb}">
                                    <Setter Property="Canvas.Right" Value="-9"/>
                                    <Setter Property="Width" Value="18"/>
                                    <Setter Property="Height" Value="{Binding Path=ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    <Setter Property="Padding" Value="0,0,0,0"/>
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                <GradientStop Color="#FFF2F2F2" Offset="0"/>
                                                <GradientStop Color="#FFD5D5D5" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border Background="#00FFFFFF" Padding="{TemplateBinding Padding}">
                                                    <Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Width="1"/>
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>
                    </Canvas>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver" Value="True"/>
                    <Trigger Property="IsPressed" Value="True"/>
                    <Trigger Property="Height" Value="NaN"/>
                    <Trigger Property="IsEnabled" Value="False"/>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="ButtonFocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <LinearGradientBrush x:Key="ButtonBackground" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFF9EED9" Offset="0"/>
                <GradientStop Color="#FFFAA700" Offset="0.585"/>
            </LinearGradientBrush>
            <SolidColorBrush x:Key="ButtonBorderBrush" Color="#FFFAA700"/>
            <LinearGradientBrush x:Key="ButtonBackgroundOver" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                <GradientStop Color="#FFFDC24B" Offset="0.42"/>
            </LinearGradientBrush>
            <SolidColorBrush x:Key="ButtonBackgroundPressed" Color="#FFFAA700"/>
            <Style x:Key="ButtonStyle" TargetType="{x:Type Button}" BasedOn="{x:Null}">
                <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">

                            <!-- We use Grid as a root because it is easy to add more elements to customize the button -->
                            <Grid x:Name="Grid" Height="25">

                                <Border x:Name="Border" BorderBrush="{DynamicResource ButtonBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Background="{DynamicResource ButtonBackground}" CornerRadius="8,8,8,8"/>

                                <!-- Content Presenter is where the text content etc is placed by the control -->
                                <!-- The bindings are useful so that the control can be parameterized without editing the template -->
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="24,1,24,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" TextElement.FontSize="11"/>
                            </Grid>

                            <!--Each state sets a brush on the Border in the template -->
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsKeyboardFocused" Value="true">
                                    <Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/>
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="Border" Value="{DynamicResource ButtonBackgroundOver}"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Background" TargetName="Border" Value="{DynamicResource ButtonBackgroundPressed}"/>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ButtonBackgroundPressed}"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="true"/>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Background" TargetName="Border">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#33F9EED9" Offset="0"/>
                                                <GradientStop Color="#33FAA700" Offset="0.585"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="#33FAA700"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}">
                <Setter Property="SnapsToDevicePixels" Value="true"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ComboBox}">
                            <Grid>
                                <!-- The ToggleButton is databound to the ComboBox itself to toggle IsDropDownOpen -->
                                <ToggleButton Grid.Column="2" Template="{DynamicResource ComboBoxToggleButton}" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"/>
                                <ContentPresenter HorizontalAlignment="Left" Margin="11,4,23,4" x:Name="ContentSite" VerticalAlignment="Center" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" IsHitTestVisible="False" d:IsHidden="True"/>

                                <!-- The TextBox must be named PART_EditableTextBox or ComboBox will not recognize it -->
                                <TextBox Visibility="Hidden" Template="{DynamicResource ComboBoxTextBox}" HorizontalAlignment="Left" Margin="3,3,23,0" x:Name="PART_EditableTextBox" Style="{x:Null}" VerticalAlignment="Center" Focusable="True" Background="Transparent" IsReadOnly="{TemplateBinding IsReadOnly}"/>

                                <!-- The Popup shows the list of items in the ComboBox. IsOpen is databound to IsDropDownOpen which is toggled via the ComboBoxToggleButton -->
                                <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
                                    <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
                                        <Border x:Name="DropDownBorder" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1" CornerRadius="8,8,8,8"/>
                                        <ScrollViewer Margin="4,6,4,6" Style="{DynamicResource SimpleScrollViewer}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">

                                            <!-- The StackPanel is used to display the children by setting IsItemsHost to be True -->
                                            <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>

                                        </ScrollViewer>
                                    </Grid>
                                </Popup>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <!-- This forces the DropDown to have a minimum size if it is empty -->
                                <Trigger Property="HasItems" Value="false">
                                    <Setter Property="MinHeight" Value="95" TargetName="DropDownBorder"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
                                </Trigger>
                                <Trigger Property="IsGrouping" Value="true">
                                    <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                                </Trigger>
                                <Trigger Property="AllowsTransparency" SourceName="Popup" Value="true">
                                    <Setter Property="CornerRadius" Value="4" TargetName="DropDownBorder"/>
                                    <Setter Property="Margin" Value="0,2,0,0" TargetName="DropDownBorder"/>
                                </Trigger>
                                <Trigger Property="IsEditable" Value="true">
                                    <Setter Property="IsTabStop" Value="false"/>
                                    <Setter Property="Visibility" Value="Visible" TargetName="PART_EditableTextBox"/>
                                    <Setter Property="Visibility" Value="Hidden" TargetName="ContentSite"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
                <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                <Setter Property="Padding" Value="3,0,3,0"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                            <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="8,4,8,4"/>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsHighlighted" Value="true">
                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                                    <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ListViewItemMouseOverBackground}"/>
                                    <Setter Property="CornerRadius" TargetName="Bd" Value="8,8,8,8"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <BorderGapMaskConverter x:Key="BorderGapMaskConverter"/>
            <Style x:Key="GroupBoxStyle" TargetType="{x:Type GroupBox}">
                <Setter Property="BorderBrush" Value="#D5DFE5"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GroupBox}">
                            <Grid SnapsToDevicePixels="true">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="6"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="6"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="6"/>
                                </Grid.RowDefinitions>
                                <Border Background="{TemplateBinding Background}" BorderBrush="#00D66666" BorderThickness="1,1,1,1" CornerRadius="4" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3"/>
                                <Border x:Name="Header" Padding="3,1,3,0" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2">
                                    <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" Margin="8,0,8,0"/>
                                </Border>
                                <ContentPresenter Margin="11,8,11,8" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2"/>
                                <Border BorderBrush="{x:Null}" BorderThickness="1" CornerRadius="8,8,8,8" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3">
                                    <Border.OpacityMask>
                                        <MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="10">
                                            <Binding Path="ActualWidth" ElementName="Header"/>
                                            <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
                                            <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
                                        </MultiBinding>
                                    </Border.OpacityMask>
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}">
                <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="AllowDrop" Value="true"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TextBox}">
                            <Grid>
                                <Border x:Name="Border" Background="#FFFFFFFF" BorderBrush="#FFFFFFFF" BorderThickness="1" Padding="2" CornerRadius="8,8,8,8">

                                    <!-- The implementation places the Content into the ScrollViewer. It must be named PART_ContentHost for the control to function -->
                                    <ScrollViewer Margin="8,0,8,0" x:Name="PART_ContentHost" Style="{DynamicResource SimpleScrollViewer}" Background="{TemplateBinding Background}" FontSize="11"/>

                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
                                    <Setter Property="BorderBrush" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
                                    <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}"/>
            </Style>            
            <Style x:Key="PasswordBoxStyle" TargetType="{x:Type PasswordBox}">
                <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="AllowDrop" Value="true"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type PasswordBox}">
                            <Grid>
                                <Border x:Name="Border" Background="#FFFFFFFF" BorderBrush="#FFFFFFFF" BorderThickness="1" Padding="2" CornerRadius="8,8,8,8">

                                    <!-- The implementation places the Content into the ScrollViewer. It must be named PART_ContentHost for the control to function -->
                                    <ScrollViewer Margin="8,0,8,0" x:Name="PART_ContentHost" Style="{DynamicResource SimpleScrollViewer}" Background="{TemplateBinding Background}" FontSize="11"/>

                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
                                    <Setter Property="BorderBrush" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
                                    <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}"/>
            </Style>
            <Style x:Key="RadioButtonStyle" TargetType="{x:Type RadioButton}">
                <Setter Property="SnapsToDevicePixels" Value="true"/>
                <Setter Property="FocusVisualStyle" Value="{DynamicResource RadioButtonFocusVisual}"/>
                <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type RadioButton}">

                            <!-- BulletDecorator is used to provide baseline alignment between the checkmark and the Content -->
                            <BulletDecorator Background="Transparent">
                                <BulletDecorator.Bullet>
                                    <Grid Width="13" Height="13">
                                        <Ellipse x:Name="Ellipse_Border" Fill="{TemplateBinding Background}" Stroke="{DynamicResource ButtonBorderBrush}" StrokeThickness="1"/>
                                        <Ellipse Margin="4" x:Name="CheckMark" Fill="{DynamicResource GlyphBrush}"/>
                                    </Grid>
                                </BulletDecorator.Bullet>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="8,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                            </BulletDecorator>

                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="false">
                                    <Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Fill" Value="{DynamicResource MouseOverBrush}" TargetName="Ellipse_Border"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Fill" Value="{DynamicResource PressedBrush}" TargetName="Ellipse_Border"/>
                                    <Setter Property="Stroke" Value="{DynamicResource GlyphBrush}" TargetName="Ellipse_Border"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Ellipse_Border"/>
                                    <Setter Property="Foreground" Value="#80000000"/>
                                    <Setter Property="Stroke" TargetName="Ellipse_Border" Value="{DynamicResource ButtonBorderBrush}"/>
                                </Trigger>

                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
                <Setter Property="SnapsToDevicePixels" Value="true"/>
                <Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}"/>
                <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type CheckBox}">

                            <!-- BulletDecorator is used to provide baseline alignment between the checkmark and the Content -->
                            <BulletDecorator Background="Transparent">
                                <BulletDecorator.Bullet>
                                    <Grid Width="13" Height="13">
                                        <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{DynamicResource ButtonBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,3,3,3"/>
                                        <Path x:Name="CheckMark" Stroke="{DynamicResource GlyphBrush}" StrokeThickness="2" SnapsToDevicePixels="False" Data="M 0 0 L 13 13 M 0 13 L 13 0"/>
                                    </Grid>
                                </BulletDecorator.Bullet>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="8,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                            </BulletDecorator>

                            <!-- This uses Visibility to hide and show the CheckMark on IsChecked -->
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="false">
                                    <Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" Value="{DynamicResource MouseOverBrush}" TargetName="Border"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Background" Value="{DynamicResource PressedBrush}" TargetName="Border"/>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ButtonBorderBrush}"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ButtonBorderBrush}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>

                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


            <!--
										<Rectangle RadiusX="8" RadiusY="8" x:Name="Indicator" Grid.ColumnSpan="3" Grid.RowSpan="2" Stroke="#FFFBB03B" d:IsHidden="True" d:IsLocked="True">
		    								<Rectangle.Fill>
		    									<LinearGradientBrush EndPoint="0.403,0.563" StartPoint="0.327,0.185" SpreadMethod="Repeat">
		    										<GradientStop Color="#FFFBB03B" Offset="0.205"/>
		    										<GradientStop Color="#FFFA4B00" Offset="0.241"/>
		    										<GradientStop Color="#FFFBB03B" Offset="0.862"/>
		    										<GradientStop Color="#FFFA4B00" Offset="0.821"/>
		    									</LinearGradientBrush>
		    								</Rectangle.Fill>
		    							</Rectangle>
										-->









        </ResourceDictionary>

    </Application.Resources>
</Application>